package com.beilang.hotline.telephone.dao;

import com.beilang.base.core.dao.BaseDAO;
import com.beilang.base.util.DateUtil;
import com.beilang.hotline.telephone.model.TelephoneModel;

import java.util.*;

public class TelephoneDAO extends BaseDAO {
    public List searchTelephoneList(Date dateFrom, Date dateTo) {
        Map map = new HashMap();
        map.put("dateFrom", dateFrom);
        dateTo = DateUtil.add(dateTo, Calendar.DATE, 1);
        map.put("dateTo", dateTo);
        return getSqlMapClientTemplate().queryForList("searchTelephoneList", map);
    }

      public List searchUserRptList(Date dateFrom, Date dateTo) {
        Map map = new HashMap();
        map.put("dateFrom", dateFrom);
        dateTo = DateUtil.add(dateTo, Calendar.DATE, 1);
        map.put("dateTo", dateTo);
        return getSqlMapClientTemplate().queryForList("searchUserRptList", map);
    }

      public List searchNumberRptList(Date dateFrom, Date dateTo) {
        Map map = new HashMap();
        map.put("dateFrom", dateFrom);
        dateTo = DateUtil.add(dateTo, Calendar.DATE, 1);
        map.put("dateTo", dateTo);
        return getSqlMapClientTemplate().queryForList("searchNumberRptList", map);
    }

    public TelephoneModel createTelephone(TelephoneModel telephoneModel) {
        return (TelephoneModel)this.save(telephoneModel);
	}

	public TelephoneModel saveTelephone(TelephoneModel telephoneModel) {
		return (TelephoneModel)this.save(telephoneModel);
	}
}
